import request from "./request";

/** 评论 */

//评论
export async function comment (param,params) {
  return await request({
    url: '/comment/insert',
    method: 'post',
    data:param,
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

//查询评论:/select/{type}/{cardId}/{current}/{size}
export async function getComment (param,params) {
  return await request({
    url: '/comment/select/'+param.type+'/'+param.id+'/'+param.current+'/'+param.size+'/'+params.userId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

//评论点赞
export async function addLike (param,params) {
  return await request({
    url: '/comment/clickLike/'+param.id+'/'+params.userId+'/'+param.like,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': params.token 
    }
  })
}

